/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.cv4j.rxcv4j;

import ohos.agp.components.Image;
import ohos.agp.window.dialog.IDialog;
import ohos.media.image.PixelMap;

import com.cv4j.core.datamodel.CV4JImage;
import com.cv4j.core.filters.CommonFilter;

/**
 * 包装器
 *
 * @since 2021-05-17
 */
public class Wrapper {
    PixelMap bitmap;

    CV4JImage cv4jImage;

    byte[] bytes = null;

    boolean useCache = true;

    Image imageView;

    CommonFilter filter;

    IDialog dialog = null;

    /**
     * 获取位图
     *
     * @return {@link PixelMap}
     */
    public PixelMap getBitmap() {
        return bitmap;
    }

    /**
     * 设置位图
     *
     * @param bitmap 位图
     */
    public void setBitmap(PixelMap bitmap) {
        this.bitmap = bitmap;
    }

    /**
     * 得到cv4j图像
     *
     * @return {@link CV4JImage}
     */
    public CV4JImage getCv4jImage() {
        return cv4jImage;
    }

    /**
     * 设置cv4j图片
     *
     * @param cv4jImage cv4j形象
     */
    public void setCv4jImage(CV4JImage cv4jImage) {
        this.cv4jImage = cv4jImage;
    }

    /**
     * 得到字节
     *
     * @return {@link byte[]}
     */
    public byte[] getBytes() {
        return bytes;
    }

    /**
     * 将字节
     *
     * @param bytes 字节
     */
    public void setBytes(byte[] bytes) {
        this.bytes = bytes;
    }

    /**
     * 使用缓存
     *
     * @return boolean
     */
    public boolean isUseCache() {
        return useCache;
    }

    /**
     * 设置使用缓存
     *
     * @param useCache 使用缓存
     */
    public void setUseCache(boolean useCache) {
        this.useCache = useCache;
    }

    /**
     * 得到图像视图
     *
     * @return {@link Image}
     */
    public Image getImageView() {
        return imageView;
    }

    /**
     * 设置图像视图
     *
     * @param imageView 图像视图
     */
    public void setImageView(Image imageView) {
        this.imageView = imageView;
    }

    /**
     * 得到过滤
     *
     * @return {@link CommonFilter}
     */
    public CommonFilter getFilter() {
        return filter;
    }

    /**
     * 设置过滤器
     *
     * @param filter 过滤器
     */
    public void setFilter(CommonFilter filter) {
        this.filter = filter;
    }

    /**
     * 获取对话框
     *
     * @return {@link IDialog}
     */
    public IDialog getDialog() {
        return dialog;
    }

    /**
     * 设置对话框
     *
     * @param dialog 对话框
     */
    public void setDialog(IDialog dialog) {
        this.dialog = dialog;
    }
}
